import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../components/Login";
import Register from "../components/Register";
import Home from "../components/Home";
import Content1 from "../components/home/Content1";
import Content2 from "../components/home/Content2";
import Content3 from "../components/home/Content3";
import Stest1 from "../components/start-test/Stest1";
import Stest2 from "../components/start-test/Stest2";
import Stest3 from "../components/start-test/Stest3";
import Stest4 from "../components/start-test/Stest4";
import Stest5 from "../components/start-test/Stest5";
Vue.use(VueRouter);

const routes = [
  { path: "/", redirect: "/login" },
  { path: "/login", component: Login },
  { path: "/register", component: Register },
  {
    path: "/home",
    redirect: "/home/content1",
    component: Home,
    children: [
      {
        path: "content1", //此处一定不要写：/
        component: Content1,
      },
      {
        path: "content2",
        component: Content2,
      },
      {
        path: "content3",
        component: Content3,
      },
    ],
  },
  { path: "/stest1", component: Stest1 },
  { path: "/stest2", component: Stest2 },
  { path: "/stest3", component: Stest3 },
  { path: "/stest4", component: Stest4 },
  { path: "/stest5", component: Stest5 },
];

const router = new VueRouter({
  routes,
});

export default router;
